package com.qtcm.nas.jhx.wrsj.web;

import com.qtcm.nas.jhx.bendianpinglun.service.IYuyueservice;
import com.qtcm.nas.jhx.chongzhi.service.IYushouservice;
import com.qtcm.nas.jhx.chongzhi.service.impl.Yushouservice;
import com.qtcm.nas.jhx.dianpu.service.Dianpuservice;
import com.qtcm.nas.jhx.pingjia.service.IPinglunservice;
import com.qtcm.nas.jhx.wrsj.service.IZshouruservice;
import com.qtcm.nas.jhx.yingyee.service.IYingyeeservice;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller("zshouruController")
@RequestMapping("/admin/car/bosssystem")
public class ZshouruController {
    @Resource(name = "zshouruservice")
    private IZshouruservice zshouruservice;
    @Resource(name = "dianpuservice")
    private Dianpuservice dianpuservice;
    @Resource(name = "yuyueservice")
    private IYuyueservice yuyueservice;
    @Resource(name = "pinglunservice")
    private IPinglunservice pinglunservice;
    @Resource(name = "yingyeeservice")
    private IYingyeeservice yingyeeservice;
    @Resource(name = "yushouservice")
    private IYushouservice yushouservice;


    @RequestMapping(value = "/findAll")
    public String findAll(Model model) {
        List list = dianpuservice.dianpu();
        String dianming = (String) list.get(0);
        String dianming1 = (String) list.get(1);
        model.addAttribute("dianming", dianming);
        model.addAttribute("dianming1", dianming1);
        Integer G_state = yuyueservice.findcount();//已洗数量
        model.addAttribute("G_state", G_state);
        Integer zpj = pinglunservice.countpingjia();//评价数量
        model.addAttribute("zpj", zpj);
        int hpj = pinglunservice.counthpj();
        model.addAttribute("hpj", hpj);
        List list2 = yingyeeservice.jine();
        int i6 = (int) list2.get(6);
        model.addAttribute("i6", i6);//当日会员消费
        int zongqian = yushouservice.zongqian();
        model.addAttribute("zongqian", zongqian);
        int fwmoney= zshouruservice.fw_money();
        model.addAttribute("fwmoney",fwmoney);
        int kdshouru= zshouruservice.fw_money();
        int zsr=kdshouru+zongqian;
        model.addAttribute("zsr",zsr);
        model.addAttribute("kdshouru",kdshouru);//开单收入
        return "before_storedata";
    }
}
